<template>
	<view>
		<tm-row :width="686" :column="10" transprent="true">
			<tm-col :col="1" align="end">
				<tm-text color="red"> *</tm-text>
			</tm-col>
			<tm-col :col="9" align="start">
				<tm-text fontSize="35"> 姓名</tm-text>
			</tm-col>
		</tm-row>
		<input class="uni-input" type="text" placeholder="请输入姓名" style="margin-left: 35px;  margin-top: 15px;"
			v-model="name" />
		<tm-divider color="black"></tm-divider>
		<tm-row :width="686" :column="10" transprent="true">
			<tm-col :col="1" align="end">
				<tm-text color="red"> *</tm-text>
			</tm-col>
			<tm-col :col="9" align="start">
				<tm-text fontSize="35"> 身份证号</tm-text>
			</tm-col>
		</tm-row>
		<input class="uni-input" type="text" placeholder="请输入身份证号码" style="margin-left: 35px;  margin-top: 15px;"
			v-model="idNo" />
		<tm-divider color="black"></tm-divider>
		<tm-button :round="12" linear="right" linearDeep="dark" label="保存" style="margin: auto; margin-top: 20px;"
			width="600" @click="setKyc()"></tm-button>
	</view>
</template>

<script>
	import {
		compile
	} from 'vue';
	export default {
		data() {
			return {
				mbId: '',
				name: '',
				idNo: '',
				msg: ''
			}
		},
		onLoad(id) {

			console.log(id);
			let phoneDate = id.data
			this.mbId = phoneDate;


		},
		methods: {


			//实名认证
			setKyc() {
				uni.request({
					url: "/app/mb/kyc.do",
					method: 'POST',

					data: JSON.stringify({
						mbId: this.mbId,
						name: this.name,
						idNo: this.idNo
					}),
					header: { // 设置请求的header
						'content-type': 'application/json', // 指定请求头，比如设置Content-Type
					},
					success: (res) => {
						let requ = res.data.msg;
						this.msg = requ;
						console.log(this.msg)
						uni.showToast({
							title: requ,
							icon: 'none', // 显示无图标
							duration: 2000 // 持续时间，单位为毫秒
						});
						// 在请求成功时返回的数据
					}

				})
			}
		}
	}
</script>

<style>

</style>